﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Threading;

namespace LEDShow.Helpers
{
    public class JobNumToImagePathConverter : IValueConverter
    {
        private static object obj = new object();

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            lock (obj)
            {
                string uriStr = GlobalVariables.LoadHeadImage((string)value);

                if (null == uriStr)
                    return null;

                return new BitmapImage(new Uri(uriStr));
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }


    }
}
